<template>

    <a-card title="小程序配置">
        <a-row>

            <a-col class="margin-b-1rem" :span="4">appId</a-col>
            <a-col class="margin-b-1rem" :span="20">
                <a-input v-model="config.appId" placeholder="请填写小程序的appId"></a-input>
            </a-col>
            <a-col  class="margin-b-1rem" :span="4">页面路径</a-col>
            <a-col  class="margin-b-1rem" :span="20">
                <a-input v-model="config.pagePath" placeholder="请输入小程序的页面路径，如：pages/index"></a-input>
            </a-col>
            <a-col  class="margin-b-1rem" :span="4">备用网页</a-col>
            <a-col class="margin-b-1rem" :span="20">
                <a-input v-model="config.url" placeholder="不支持小程序的老版本客户端将打开本网页"></a-input>
            </a-col>

        </a-row>
    </a-card>


</template>
<script>

    export default {
        props: ['dataSource'],
        data() {
            return {
                config:{
                    appId: "",
                    pagePath: "",
                    url: "",
                }

            }
        },


        created() {
            if (this.dataSource) {
                this.config = JSON.parse(this.dataSource);

            }
        },
        watch: {
            config:{

                handler(curVal){
                    this.$emit("callBack", curVal);
                },
                deep:true
            }

        }

    }
</script>
<style scoped>
</style>
